CLASS ymoon_040_test DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.
    INTERFACES if_oo_adt_classrun.

    "상수
    CONSTANTS:
      content_type TYPE string VALUE 'Content-type',
      json_content TYPE string VALUE 'application/json; charset=UTF-8'.


ENDCLASS.



CLASS YMOON_040_TEST IMPLEMENTATION.


  METHOD if_oo_adt_classrun~main.

    MODIFY ENTITIES OF i_productionordertp ENTITY productionorder
      EXECUTE release
      FROM VALUE #( ( productionorder = '000001000082' ) )
      RESULT DATA(lt_result)
      MAPPED DATA(lt_mapped)
      FAILED DATA(lt_failed)
      REPORTED DATA(lt_reported).

    COMMIT ENTITIES RESPONSE OF i_productionordertp
    FAILED DATA(ltc_failed)
    REPORTED DATA(ltc_reported).


    DATA:gt_itab TYPE TABLE OF i_materialdocumentitem_2.

*    READ ENTITIES OF YMOON_040_CDS
*    entity YMOON_040_CDS
*        ALL FIELDS
*        WITH value #( ( %key-MaterialDocumentYear ='2023' ) )
*        RESULT DATA(lt_result)
*        FAILED DATA(lt_failed)
*        REPORTED DATA(lt_reported).

*    SELECT material,plant, storagelocation, goodsmovementtype, quantityinbaseunit, materialbaseunit
*    FROM i_materialdocumentitem_2
*    WHERE postingdate = '20231110'
*    INTO CORRESPONDING FIELDS OF TABLE @gt_itab.

*    LOOP AT lt_result ASSIGNING FIELD-SYMBOL(<fs>).
*      out->write( <fs>-material ).
*    ENDLOOP.

    SELECT FROM ymoon_040_cds
    FIELDS purchaseorder
    INTO TABLE @DATA(lt_itab)
    UP TO 10 ROWS.

    LOOP AT lt_itab ASSIGNING FIELD-SYMBOL(<fs>).
      out->write( <fs>-purchaseorder ).
    ENDLOOP.

  ENDMETHOD.
ENDCLASS.
